#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
void* my_memmove(void* dest, void* scr,size_t num )
{
	assert(dest);
	assert(scr);
	void* ret = dest;
	if (dest < scr)
	{
		while (num--)
		{
			*(char*)dest = *(char*)scr;
			dest = (char*)dest + 1;
			scr = (char*)scr + 1;
		}
	}
	else
	{
		while (num--)
		{
			*((char*)dest + num) = *((char*)scr + num);
		}
	}

	return ret;
}
int main()
{
	char arr1[20] = "it is long xxxxxago.";
	my_memmove(arr1+11, arr1+6, 5);
	int i = 0;
	for (i = 0; i < 20; i++)
	{
		printf("%c", arr1[i]);
	}
	return 0;
}